#pragma once

#include <cstdint>

namespace limbo::ip {

struct IPv4Address {

  static IPv4Address from_native(uint32_t);
  static IPv4Address from_network(uint32_t);

  IPv4Address() : net_value{0} {}
  IPv4Address(IPv4Address &&) = default;
  IPv4Address(const IPv4Address &) = default;

  uint32_t as_net() const { return net_value; }

  bool operator==(const IPv4Address &other) const {
    return net_value == other.net_value;
  }

  IPv4Address &operator=(const IPv4Address &addr) {
    net_value = addr.net_value;
    return *this;
  }

  uint32_t net_value;

private:
  explicit IPv4Address(uint32_t net_value_) : net_value{net_value_} {}
};

} // namespace limbo::ip
